import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

import Login from '@/components/login/login'
import Index from '@/components/index/index'
import Register from '@/components/register/register'

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/index/login'
    },
    {
      path: '/index',
      component: Index,
      children: [
        {
          path: 'login',
          component: Login
        },
        {
          path: 'register',
          component: Register
        }
      ]
    }
  ]
})
